$(document).ready(function(){
	var username = $('input[name="username"]');
	var password = $('input[name="password"]');
	var submit = $('button[type="submit"]');
	
	// login form validation
	submit.click(function(event) {
		if(password.val() == '') {
			$('span.message').text('Please enter password. ');
			event.preventDefault();
		}
		if(username.val() == '') {
			$('span.message').text('Please enter username. ');
			event.preventDefault();
		}
	});
	
	// set active navigation item
	$('li#index').addClass('active');

    // set tab action
    $('#topBookTab a').click(function (e) {
        e.preventDefault()
        $(this).tab('show')
    })

});